package online.longzipeng.mywebdemo;

import lombok.extern.slf4j.Slf4j;
import online.longzipeng.mywebdemo.service.MyService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Author: lzp
 * @description: 多服务实现测试
 * @Date: 2023/2/26
 */
@Slf4j
@SpringBootTest(classes = MyWebDemoApplication.class,
		webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class MyServiceDemo {

	@Autowired
//	@Qualifier("MyServiceB")
//	@Resource(name = "MyServiceB") // 假如@Resource和@Primary同时存在，那么@Resource中的name指定的bean，优先级更高
	private MyService myService;

	@Test
	public void testDemo() {
		myService.hello();
	}

}
